package com.chenille.tools.http.interceptor

import com.chenille.tools.http.download.ProgressResponseBody
import okhttp3.Interceptor
import okhttp3.Response

/**
 * @desc
 * @contact   cnhttt@163.com
 * @author  couldxtra
 * @time  2022/3/5 11:47 下午
 * @version v1.0
 * @update: [序号:1][日期YYYY-MM-DD:2022/3/5] [更改人姓名:F][变更描述:create]
 */
class ProgressInterceptor: Interceptor {
    override fun intercept(chain: Interceptor.Chain): Response {

        val originalResponse =   chain.proceed(chain.request())
        return originalResponse.newBuilder().body(ProgressResponseBody(originalResponse.body)).build()
    }
}